<?
session_start();
include('../config.php');
include("../classes/connect.php");
require_once('../classes/class.jira.php');


        $arr_out = array();
        
        $getId="SELECT id FROM trn_emaildetails WHERE date(FROM_UNIXTIME(recordedDate))>='2013/9/1'";      
        $out=mysql_query($getId);        
        while($rowShortlist=mysql_fetch_array($out))
        { 
              $shortlist = "SELECT * , date( FROM_UNIXTIME( modifiedDate ) ) AS modidate, concat( FROM_UNIXTIME( modifiedDate ) ) AS modi, MAX( concat( FROM_UNIXTIME( modifiedDate ) ) ) AS maxm, MIN( concat( FROM_UNIXTIME( modifiedDate ) ) ) AS minm, datediff( MAX( concat( FROM_UNIXTIME( modifiedDate ) ) ) , MIN( concat( FROM_UNIXTIME( modifiedDate ) ) ) ) AS dele
                        FROM trn_activity
                        WHERE mainId = '".$rowShortlist['id']."'
                        AND (
                        ACTION = 'OpenCV'
                        OR ACTION = 'Rejected'
                        )";
              
               $outDelay=mysql_query($shortlist);        
                while($rowDelay=mysql_fetch_array($outDelay))
                { 
                    $arr=array(
                        //'mianId'=>$rowDelay['mainId'],
                        'date'=>date('m/d/Y',strtotime($rowDelay['modidate'])),
                        'no'=>'1',
                        'symbol'=>'OpenCV-Rejected'
                    );
                    
                    //$arr_out[]= $rowDelay['dele'];   
                    $arr_out[]=$arr;
                }
        }
      echo json_encode($arr_out);

?>	